import {Modal, Icon} from 'antd';
import { SmileOutlined } from '@ant-design/icons';
import '@ant-design/compatible/assets/index.css';
import React, { useState, useCallback, useRef, useEffect } from 'react';
import styles from './AuditForms.less'

const SuccessModal = (props) => {
  const {orderId, successModalVisible, onClose} = props

  useEffect(()=>{
    if(successModalVisible) {
      setTimeout(()=>{
        onClose()
      },5000)
    }
  },[successModalVisible])

  return (
    <Modal
      visible={successModalVisible}
      title=''
      footer={null}
      centered
      keyboard={false}
      maskClosable={false}
      onCancel={onClose}
      width='500'
      className={styles.successModal}
    >
      <div className={styles.wrap}>
        <div className={styles.iconWrap}>
          <Icon type="smile" style={{ fontSize: '100px'}}/>
        </div>
        <div style={{marginTop: '20px',color: 'rgb(255, 135, 109)'}}><b>补偿单审核完成！</b></div>
        <div style={{marginTop: '10px', color: '#999'}}>补偿单号：{orderId}</div>
        <div style={{marginTop: '20px'}}><b>5S</b>后关闭</div>
      </div>
    </Modal>
  )
}

export default SuccessModal